package com.gupaowork.pattern.observer;


import java.util.Observable;

public class GPer extends Observable {
    private GPer(){
    }
    private String name = "Gper社区";

    private static class GPerHolder{
        private static GPer gPer = new GPer();
    }
    public static GPer getInstance(){
        return GPerHolder.gPer;
    }
    public void publishQuestion(Question question) {
        System.out.println(question.getName() + "在" +this.name+"提交了问题,内容是："+question.getContent());
        setChanged();
        notifyObservers(question);
    }
}
